/**
* Vista asociada al contenido 
* TAB DE INFORMACION DE UN DETERMINADO PROYECTO
* en el aplicativo.
*/
Ext.define('entgpv11.view.Details', {
    extend: 'Ext.Panel',
    alias: 'widget.details',
    id: 'myDetails',
    requires: [
        'entgpv11.view.details.UsgsMap',
		'entgpv11.view.details.NoteEditor',
		'entgpv11.view.details.ImageList',
		'entgpv11.view.details.VideoList',
		'entgpv11.view.details.DocList',
        'entgpv11.view.details.UpdateInfo'
    ],
    config: {
        fullscreen: true,
        layout:
        {
            type: "card"
        },
        dataArguments: null,
        backType: 'back',//Identificador evento
        dataId: 0 //Data Id
    },
   
    initialize: function () {
        this.callParent(arguments);
        this.backButton = {
            xtype: "button",
            ui: "back",
            iconCls: "reply", iconMask: true,
            handler: this.onBackButtonTap,
            scope: this
        };
        this.exitButton = {
            xtype: "button",
            ui: 'decline',
            iconCls: "delete", iconMask: true,
            handler: this.onExitButtonTap,
            scope: this
        };
        this.topToolbar = {
            xtype: "toolbar",
            id: "toolbar-top",
            docked: "top",
            title: "",
            items: [
                this.backButton,
                { xtype: "spacer" },
                this.exitButton
            ]
        };

        this.tabGlobal =
        {
            xtype: 'tabpanel',
            id: 'tabDetails',
            scrollable: 'vertical',
            tabBarPosition: 'bottom',
            listeners: {
                activeitemchange: { fn: this.onCloseToolbar, scope: this }
            },
            items: [
						{
						    xtype: 'noteeditor',
						    //id: "jtabs-1",
						    title: 'Detalles',
						    iconCls: 'info'
						},
                     
                       	{
                       	    xtype: 'updateinfo',
                          	//id: "jtabs-3",
                          	title: 'Avance',
                          	iconCls: 'compose'
                        },
                       
                       	{
						    xtype: 'usgsmap',
						    //id: "jtabs-2",
						    title: 'Mapa',
						    iconCls: 'locate'
						},
                        {
                            xtype: 'imagelist',
                            //id: "jtabs-3",
                            title: 'Imagenes',
                            iconCls: 'photos2'
                        },/*
                        {
                            xtype: 'videolist',
                            //id: "jtabs-4",
                            title: 'Videos',
                            iconCls: 'arrow_right'
                        },*/
                        {
                            xtype: 'doclist',
                            //id: "jtabs-4",
                            title: 'Documentos',
                            iconCls: 'bookmarks'
                        }

                ]
        };
        this.add([this.topToolbar, this.tabGlobal]);
        /*
        this.on({
        scope: this,
        show: this.onShow
        });*/

    },
    onBackButtonTap: function () {
        this.fireEvent("backToHomeCommand", this);
    },
    onCloseToolbar: function (me, newActiveItem, oldActiveItem, eOpts) {
        this.fireEvent("closeToolbarCommand", me, newActiveItem, oldActiveItem);
    },
    onExitButtonTap: function () {
        this.fireEvent("exitButtonTapCommand", this);
    },
    
    onTrackingButtonTap: function () {
        this.fireEvent("trackingButtonTapCommand", this);
    },
    onTrafficButtonTap: function () {
        this.fireEvent("trafficButtonTapCommand", this);
    }
});
